package com.HomeWorkhsp.Chapter07;

/**
 * Enjoy programming!!!
 * Time: 2021/11/9 -  16:48
 */
public class Test02 {
    public static void main(String[] args) {
        Book b = new Book(10.8);
        b.updatePrice();
        System.out.println(b.price);
    }
}

class Book {
    double price;

    public Book(double price) {
        this.price = price;
    }

    public void updatePrice() {
        if (this.price > 100 && this.price < 150){
            this.price = 100;
        }
        else if (this.price > 150){
            this.price = 100;
        }
    }

}
